import salt.client
import salt.config
from telegram import Bot
def send_tg(message):
    bot = Bot(token = "659846052:AAGUAGdcfmOgWT1bLUue-BP10Y8zqdXCwIE")
    bot.send_message(-283191470, str(message))
client = salt.client.LocalClient()
master= salt.config.client_config('/etc/salt/master')
minion = salt.config.minion_config('/etc/salt/minion')
cmd1=client.cmd('kafka*','cmd.run',['/bin/sh /data/app/zookeeper/zookeeper-3.4.6/bin/zkServer.sh status'])
#send_tg(cmd1)
for i in cmd1:
    a = i + ':' +  str(cmd1[i])
    send_tg(a)